package com.huitone.smspfm.interfacz.core.reduser;

import java.util.concurrent.ConcurrentLinkedQueue;

import com.huitone.smspfm.interfacz.logger.ExtLogger;


public class RedUserTask  extends Thread{
	
	private final static ExtLogger logger =ExtLogger.create(RedUserTask.class);
	
	/**
	 * 红名单短信序列号队列
	 */
	public static ConcurrentLinkedQueue<String>  redUserSmsSerial = new ConcurrentLinkedQueue<String>();
	
	/**
	 * 结果队列－成功
	 */
	public static ConcurrentLinkedQueue<String>  redUserSmsReport = new ConcurrentLinkedQueue<String>();
	
	/**
	 * 结果队列－失败
	 */
	public static ConcurrentLinkedQueue<String>  redUserSmsReportError = new ConcurrentLinkedQueue<String>();
	
	private boolean keepGoing = true;
	
	private Long sleepTime = 1 * 60 * 1000L;
	
	public boolean isKeepGoing() {
		return keepGoing;
	}

	public void setKeepGoing(boolean keepGoing) {
		this.keepGoing = keepGoing;
	}
	
	

	@Override
	public void run() {
		while(keepGoing && ! this.isInterrupted()){
			boolean toSleep = true;
			try{
				
			}catch(Exception e){
				toSleep = true;
			}
			if(toSleep){
			try {
				Thread.sleep(sleepTime);
			} catch (InterruptedException e) {}
			}
		}
	}

	@Override
	public void destroy() {
		this.setKeepGoing(false);
		this.interrupt();
	}

}
